---
title: Get PDF version
summary: Validates a submitted PDF and returns its PDF version header value.
status: draft
owner: Not determined from source
last_reviewed: 2026-09-17
library: PdfAPI
reference_type: embedded
operation_id: OP-GET-PDF-VERSION
trigger: Client submits POST v1/info/version with PDF bytes
---

# OP-GET-PDF-VERSION: Get PDF version

Validates a submitted PDF and returns its version header (e.g. `1.7`), or an empty string when no header match is found.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-GET-PDF-VERSION |
| **Trigger** | Client submits `POST v1/info/version` with PDF bytes |
| **Entry endpoint** | [`POST v1/info/version`](../endpoints/info-controller.md#post-v1%2Finfo%2Fversion) |
| **Owning component** | `InfoController.Version(byte[])` → `PdfClientService.Version(byte[])` |
| **Inputs** | Request body: `byte[]` PDF |
| **Outputs** | Bare `string` (version, or `""` when no header match) |
| **Failure response** | No `try`/`catch` on this action — any exception produces framework exception detail (`IncludeErrorDetailPolicy.Always`) before `ApiResponseHandler` runs; the final client-visible envelope is unknown** (see [Endpoints: Error response shape](../endpoints.md#error-response-shape)) |

## Steps

1. `PdfClientService.Version` validates the `%PDF-` file signature before reading the version header ([BR-PDFAPI-005](../business-rules.md#br-pdfapi-005-pdf-validity-by-file-signature)).
   - On failure: a `PdfException` is thrown reporting that the file is not a valid PDF document (exact message text is not visible in this repository); no `try`/`catch` on this action, so it escapes to the framework, producing exception detail (`IncludeErrorDetailPolicy.Always`) before `ApiResponseHandler` runs; the final client-visible envelope is unknown**.

   This logic is implemented in `PdfAPI.Core` (`PdfClientService.Version`), documented in full at [Read PDF version](../../../libraries/pdfapi-core/operations/op-04-read-pdf-version.md) (OP-04); its behavior is summarized here only as observed on this request path.

   > **Origin:** The PDF-signature validation and version-header parsing behavior described in
   > this step is implemented in `PdfAPI.Core`, not in `PdfAPI`. See the linked operation page for
   > the full delegated logic.
2. The version string is parsed from the PDF header, returning `""` if no header match is found.
3. The bare `string` is returned — HTTP `200`.

## Process flow

The following diagram shows the validation and version-parsing sequence.

```mermaid
flowchart TD
    A["POST v1/info/version"] --> B["ValidatePdf: check file signature"]
    B -->|Invalid| C["PdfException escapes to framework: 500"]
    B -->|Valid| D["Parse version header"]
    D --> E["Return string, 200"]
```

## Transaction and side effects

| Aspect | Finding |
| --- | --- |
| Unit of work | None |
| Commit point | Not applicable — no database access |
| Records written | None |
| Downstream calls | None |
| Repeat-call behavior | Read-only; safe to repeat |

## Logging

| Surface | Written content |
| --- | --- |
| — | No dedicated logging observed on this path beyond framework-level exception logging on an uncaught failure |

## Error handling

- Non-PDF payload: `PdfException` escapes uncaught, producing framework exception detail before `ApiResponseHandler` runs; the final client-visible envelope is unknown** ([BR-PDFAPI-005](../business-rules.md#br-pdfapi-005-pdf-validity-by-file-signature); see [Endpoints: Error response shape](../endpoints.md#error-response-shape)).

## Related documentation
- [API index](../index.md)
- [Overview](../overview.md)
- [Architecture](../architecture.md)
- [Endpoints](../endpoints.md)
- [Authentication and authorization](../authentication-authorization.md)
- [Dependencies](../dependencies.md)
- [Configuration](../configuration.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Data model](../data-model.md)
- [Operational runbook](../operational-runbook.md)
- [Tech debt](../tech-debt.md)

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- PdfAPI\Controllers\v1\InfoController.cs
- PdfAPI.Core\Services\PdfClientService.cs
